﻿namespace cswork4
{
    public class Program
    {
        static void Main()
        {
            int[] arr = new int[100];
            Random random = new Random();
            for (int i = 0; i < arr.Length; i++)
                arr[i] = random.Next(1000) + 1;
            var arr_sort = arr.Select(i => i).OrderByDescending(i => i).ToArray();
            var arr_sum = arr_sort.Sum();
            var arr_ave = arr_sort.Average();
            foreach(int i in arr_sort)
                Console.WriteLine(i);
            Console.WriteLine("sum = "+ arr_sum);
            Console.WriteLine("ave = "+ arr_ave);
            
        }
    }
}